package ${packageName};

<#if applicationPackage??>
import ${applicationPackage}.R;
import ${applicationPackage}.BR;
<#if isStronglyType>
import ${applicationPackage}.databinding.${className}Binding;
</#if>
</#if>
<#if !isStronglyType>
import android.databinding.BaseObservable;
import android.databinding.ViewDataBinding;
</#if>

<#if isGenerateIView>
import <#if applicationPackage??>${applicationPackage}.</#if>model.viewModel.interfaces.${iViewName};
</#if>

<#if includeViewModel>
import com.jone.base.ui.BindingBaseFragment;
import <#if applicationPackage??>${applicationPackage}.</#if>model.viewModel.${viewModelClass};
<#else>
import com.jone.base.ui.BindingBaseViewModelProviderFragment;
import com.dywl.groupbuy.model.viewModel.interfaces.IFragmentViewModelProvider;
</#if>

/**
 *  ${classDescribe}
 */
public class ${className} extends <#if includeViewModel>BindingBaseFragment<#if isStronglyType><${viewModelClass}, ${className}Binding></#if><#if isGenerateIView> implements ${iViewName}</#if><#else>BindingBaseViewModelProviderFragment</#if> {

    <#if !includeViewModel>
    public ${className}(IFragmentViewModelProvider viewModelProvider) {
        super(viewModelProvider);
    }
    </#if>

    @Override
    protected int layoutResId() {
        return R.layout.${layoutName};
    }

    <#if includeViewModel>
    @Override
    protected <#if isStronglyType>${viewModelClass}<#else>BaseObservable</#if> onCreateViewModel() {
        return  new ${viewModelClass}(<#if isGenerateIView>this</#if>);
    }
    </#if>

    @Override
    protected void setVariable(<#if isStronglyType>${className}Binding binding, ${viewModelClass} viewModel<#else>ViewDataBinding binding, BaseObservable viewModel</#if>) {

        binding.setVariable(BR.viewModel, viewModel);

    }
}
